package grape.composite.rest.workcalendar.mvc;

import grape.composite.rest.workcalendar.form.WorkCalendarListForm;
import grape.composite.rest.workcalendar.mapper.WorkCalendarWebMapper;
import grape.composite.service.workcalendar.api.IWorkCalendarService;
import grape.composite.service.workcalendar.po.WorkCalendar;
import grape.common.rest.advice.DisableGRB;
import grape.common.rest.advice.DisableGRM;
import grape.common.rest.mvc.SuperController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * <p>
 * 工作日历 前端控制器
 * </p>
 *
 * @author yangwei
 * @since 2019-12-23
 */
@RestController
@RequestMapping("/composite/workcalendar")
@ApiIgnore
public class WorkCalendarInnerController extends SuperController {

    @Autowired
    private WorkCalendarWebMapper currentWebMapper;
    @Autowired
    private IWorkCalendarService currentService;

    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/list")
    public List<WorkCalendar> list(WorkCalendarListForm listForm) {
        WorkCalendar po = currentWebMapper.formToPo(listForm);
        return currentService.list(po);
    }

}
